import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/classify/list',
    method: 'get',
    params: query
  })
}

export function fetchClassify(id) {
  return request({
    url: '/classify/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/classify/pv',
    method: 'get',
    params: { pv }
  })
}

export function createClassify(data) {
  return request({
    url: '/classify/create',
    method: 'post',
    data
  })
}

export function updateClassify(data) {
  return request({
    url: '/classify/update',
    method: 'post',
    data
  })
}

export function deleteClassify(data) {
  return request({
    url: `/classify/${data.id}`,
    method: 'delete'
  })
}
